﻿/*-----------------------------------------------
 * 活动营销公共函数,提供常用函数
 *
 * file: /script/action_comm.js
 * author: miklchen陈进盛
 * date: 10:36 2010年5月20日
 * 
 *
 *----------------------------------------------
 */

 
/**
 * 选择排序
 */
var selectSort = function(arr) {
	for(var i = 0; i < arr.length-1; i++) {
		/* find the minimum */
		var min = i;
		for(var j = i+1; j < arr.length; j++) {
			if(parseInt(arr[j].price) < parseInt(arr[min].price)) {
				min = j;
			} else if(parseInt(arr[j].price) == parseInt(arr[min].price)) {
				//比较日期
				if(arr[j].date < arr[min].date) {
					min = j;
				}
			}
		}
		/* swap arr[i] and arr[min] */
		var tmp = arr[i];
		arr[i] = arr[min];
		arr[min] = tmp;
	}
	return arr;
}

/**
 * 删除重复元素
 */
var uniq = function(arr) {
	var flag = 0;
	for( var i = 0; i < arr.length-1; i++ ) {
		var r = arr[i];
		for( var j = i+1; j < arr.length; j++ ) {
			var next = arr[j];
			flag++;
			if(r.fcode == next.fcode &&
					r.tcode == next.tcode) {
				arr.splice(j, 1);
			}
		}
	}
	return arr;
}



/**
 * 获取radio选中值, 未选中返回""
 */
var getCheckedValue = function(radioName) {
	var radioObj = document.getElementsByName(radioName);
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

/**
 * 返回当前日期 yyyymmdd
 */
var getCurDate = function() {
	return getIsoDate(getYearMonthDay(new Date));
}

/**
 * 获取年月日格式字符串，yyyymmdd
 */
var getYearMonthDay = function(objDate) {
	var dd = objDate.getDate().toString();
	var mm = (objDate.getMonth()+1).toString();
	var yy = objDate.getFullYear().toString();
	if(dd.length == 1)
		dd = "0" + dd;
	if(mm.length == 1)
		mm = "0" + mm;
	return (yy + mm + dd);
}

/**
 * 获取标准日期 yyyy-mm-dd
 * @param date yyyymmdd
 */
var getIsoDate = function(date) {
	date = date.replace(/-/g, "");
	return date.substring(0,4) + "-" + date.substring(4,6) + "-" + date.substring(6,8);
}

/**
 * 获取月日 mm-dd
 * @param date yyyymmdd
 */
var getMonthDate = function(date) {
	date = date.replace(/-/g, "");
	return date.substring(4,6) + "-" + date.substring(6,8);
}

/**
 * 转换成日期对象
 * @param date yyyymmdd, yyyy-m-d
 */
var toDate = function(date) {
	//强行转换成string
	date += "";
	var arr = date.split("-"), yy, mm, dd;
	if( arr.length == 3 ) {
		yy = arr[0];
		mm = arr[1];
		dd = arr[2];
	} else {
		yy = date.substring(0,4);
		mm = date.substring(4,6);
		dd = date.substring(6,8);	
	}
	
	var pos = mm.indexOf("0");
	if( pos == 0 ) {
		mm = mm.substring(1,2);
	}
	pos = dd.indexOf("0");
	if( pos == 0 ) {
		dd = dd.substring(1,2);
	}
	
	yy = parseInt(yy);
	mm = parseInt(mm);
	dd = parseInt(dd);
	
	var objDate = new Date();
	objDate.setFullYear(yy, mm-1, dd);
	return objDate;
}

/**
 * 获取星期数
 */
var getWeek = function(objDate) {
	var day = objDate.getDay();//0-6
	var str = "";
	switch(day) {
		case 0:
			str = "周日";
			break;
		case 1:
			str = "周一";
			break;
		case 2:
			str = "周二";
			break;
		case 3:
			str = "周三";
			break;
		case 4:
			str = "周四";
			break;
		case 5:
			str = "周五";
			break;
		case 6:
			str = "周六";
			break;
	}
	return str;
}

/**
 * 日期比较
 * y:年 m:月 d:日 h:小时 M:分钟 s:秒
 */
var diffDate = function(beginDate, endDate, mst) {
	var year = endDate.getFullYear() - beginDate.getFullYear();
	var month = endDate.getMonth() - beginDate.getMonth();
	
	var beginTime = parseInt(beginDate.getTime()/1000);
	var endTime = parseInt(endDate.getTime()/1000);
	var iRet = 0;
	switch(mst) {
		case "y":
			iRet = year;
			break;
		case "m":
			iRet = year*12 + month;
			break;
		case "d":
			iRet = (endTime - beginTime)/(24*60*60);
			break;
		case "h":
			iRet = (endTime - beginTime)/(24*60);
			break;
		case "M":
			iRet = (endTime - beginTime)/24;
			break;
		case "s":
			iRet = endTime - beginTime;
			break;
	}
	return iRet;
}

/**
 * 日期运算
 * y:年 m:月 d:日 h:小时 M:分钟 s:秒
 */
var addDate = function(objDate, num, mst) {
	var unixTimeMill = objDate.getTime();
	switch(mst) {
		case "y":
			//unixTimeMill += (num * 365*24*60*60*1000);
			var tmpDate = new Date(unixTimeMill);
			tmpDate.setFullYear(tmpDate.getFullYear()+num);
			unixTimeMill = tmpDate.getTime();
			break;
		case "m":
			unixTimeMill += (num * 30*24*60*60*1000);
			break;
		case "d":
			unixTimeMill += (num * 24*60*60*1000);
			break;
		case "h":
			unixTimeMill += (num * 60*60*1000);
			break;
		case "M":
			unixTimeMill += (num * 60*1000);
			break;
		case "s":
			unixTimeMill += (num * 1000);
			break;
	}
	return new Date(unixTimeMill);
}


/**
 *格式化日期
 *@param strdate 20100101
 *@return 01月01日
 */
var format_date = function(strdate) {
	if(strdate == null || strdate == "" || strdate.length < 8) 
		return "";
		
	return strdate.substring(4,6) + "月" + strdate.substring(6,8) + "日";
}

/**
 * 获取小时分钟
 * @param isoDateTime yyyy-mm-dd hh:MM:ss
 * @return hh:MM
 */
var getHourMinute = function(isoDateTime) {
	return isoDateTime.substring(11, 16);
}

/**
 * 分转化成元，对于不能转换的返回0;
 * @param strFen
 * @return string 
 */
var fen2yuan = function(strFen) {
	var fen = parseInt(strFen);
	if( fen ) {
		fen = fen + "";
		return fen.substring(0,fen.length-2);
	}
	return 0;
}

/**
 * json格式的对象，转换成字符串。
 * 如: var obj ={}; obj.name='myname'; obj.age=101; 
 * 		=> {name:'myname',age:'101'}
 */
var jsonToString = function(obj) {
	var THIS = this; 
	switch(typeof(obj)){
		case 'string':
			return '"' + obj.replace(/(["\\])/g, '\\$1') + '"';
		case 'array':
			return '[' + obj.map(THIS.jsonToString).join(',') + ']';
		case 'object':
			 if(obj instanceof Array){
				var strArr = [];
				var len = obj.length;
				for(var i=0; i<len; i++){
					strArr.push(THIS.jsonToString(obj[i]));
				}
				return '[' + strArr.join(',') + ']';
			}else if(obj==null){
				return 'null';
			}else{
				var string = [];
				for (var property in obj) string.push(THIS.jsonToString(property) + ':' + THIS.jsonToString(obj[property]));
				return '{' + string.join(',') + '}';
			}
		case 'number':
			return obj;
		case false:
			return obj;
	}
}

var getQueryStringObj = function() {
	var search = window.location.search;
	return param2Obj(search);
}

/**
 * 查询参数串转化成Object
 * @param params id=1&name=cjs&age=26
 * @return obj {id:1, name:'cjs', age:26}
 */
var param2Obj = function(params) {
	var obj = {};
	if( params != null && params != undefined && params != "" ) {
		params = params.replace(/\?/, "");
		var arr = params.split('&');
		for(var index = 0; index < arr.length; index++) {
			var pair = arr[index];
			var indexOf = pair.indexOf('=');
			if(indexOf != -1) {
				var name = pair.substring(0,indexOf);
				var val = "";
				if(indexOf != pair.length-1) {
					val = pair.substring(indexOf+1);
				}
				eval("obj." + name + "='" + val + "';");
			} else {
				eval("obj." + pair + "='';");
			}
		}
	}
	return obj;
}

/**
 * obj map转换成查询参数串。
 * @param {Object} objMap map对象
 * @return {String} 返回参数串形式，a=1&b=2
 */
var objMap2Params = function(objMap) {
	var params = "";
	if( typeof(objMap) == 'object' ) {
		for (var property in objMap) {
			if( params == "" ) {
				params = property + "=" + objMap[property];
			} else {
				params += "&" + property + "=" + objMap[property];
			}
		}
	}
	return params;
}

/**
 * 提交表单信息写到cookie
 * @param flyType 1:国内 2:国际
 */
var writeCookie4Query = function(obj, flyType) {
	var options = { path: '/', expires: 365 };
	var curDate = getCurDate();
	var cookieName = (flyType == 1) ? "guoneiFormCookie" : "guojiFormCookie";

	if(flyType == 1 && parseInt(obj.back_radio) == 1) {
		obj.date2 = '';
	} else if(flyType == 2 && parseInt(obj.flytype) == 1) {
		obj.fc_rdate = '';
	}
	var formStr = $.param(obj) + "|";
	var cv = $.cookie(cookieName);
	if(cv == null || cv == "") {
		$.cookie(cookieName, formStr, options);
		return;
	}
	
	var ncv = "";
	var arr = cv.split("|");
	var MAX_HISTORY_QUERY = 10;
	var index = 0;
	if( arr.length >= MAX_HISTORY_QUERY ) {
		index = arr.length - MAX_HISTORY_QUERY + 1;
	}
	for(; index < arr.length && index < MAX_HISTORY_QUERY; index++) {
		var str = arr[index];
		if(str != null && str != "") {
			var o = param2Obj(str);
			if( o.date != null ) {
				if( !isNaN(parseInt(o.date)) && 
						(parseInt(o.date) >= parseInt(curDate)) ) {
					if( !(o.from == obj.from &&
							o.to == obj.to && 
							o.back_radio == obj.back_radio &&
							o.date == obj.date && 
							o.date2 == obj.date2) ) 
						ncv += str + "|";
				}
			} else {
				if( !isNaN(parseInt(o.fc_date)) && 
						(parseInt(o.fc_date) >= parseInt(curDate)) ) {
					if( !(o.flytype == obj.flytype &&
							o.fc_fromcity == obj.fc_fromcity &&
							o.fc_tocity == obj.fc_tocity &&
							o.fc_date == obj.fc_date &&
							o.fc_rdate == obj.fc_rdate) )
						ncv += str + "|";
				}
			}
		}
	}
	ncv += formStr;
	$.cookie(cookieName, ncv, options);
	return;
}


/**
 * <p>GB url编码</p>
 * <p>对 String 编码时，使用以下规则：</p> 
 * <ul>
 * 	<li>字母数字字符 "a" 到 "z"、"A" 到 "Z" 和 "0" 到 "9" 保持不变。 </li>
 * 	<li>特殊字符 "."、"-"、"*" 和 "_" 保持不变。 </li>
 * 	<li>空格字符 " " 转换为一个加号 "+"。 </li>
 * 	<li>所有其他字符都是不安全的，都转换成%xy的形式</li>
 * </ul>
 * @param {Object} str
 */
var urlGbEncode = function(str) {
	var ret = "";
	if( str ) {
		var specialCharacter = '.-*_';
		var chineseCharacterReg = /^[\u4E00-\u9FA5]$/;
		var len = str.length;
		for(var index = 0; index < len; index++) {
			var c = str.charAt(index);
			if( /^[A-Za-z0-9]$/.test(c) || specialCharacter.indexOf(c) > -1 ) {
				ret += c;
			} else if( " " === c ) {
				ret += "+";
			} else {
				if( chineseCharacterReg.test(c) ) {
					try {
						var gbCode = getGbChineseCharacterCode(c);
						if( gbCode.length === 4 ) {
							var hi = gbCode.substring(0,2);
							var lo = gbCode.substring(2,4);
							ret += "%" + hi + "%" + lo;
						} else {
							throw ("转换编码出错。");
						}
					} catch (e) {
						throw (e);
					}
					
				} else {
					var tmp = c.charCodeAt();
					ret += "%" + tmp.toString(16).toUpperCase();
				}
			}
		}
	}
	
	return ret;
}

/**
 * <p>获取GB汉字编码</p>
 * <p>依赖于/script/gbdata.js文件，使用此函数时要引入之。</p>
 * @param {Object} c
 * @exception 
 */
var getGbChineseCharacterCode = function(c) {
	//null,'',undeinfe
	if( !c ) {
		throw ('param is null or empty、undefine.');
	}
	
	if( c.lenth > 1 ) {
		throw ('param length too more, length must be only one.');
	}
	
	var chineseCharacterReg = /^[\u4E00-\u9FA5]$/;
	if( !chineseCharacterReg.test(c) ) {
		throw ('this character is not Chinese.');
	}
	
	var len = g_GB2312ChineseCharacterData.length;
	for(var row = 0; row < len; row++) {
		var areaStr = g_GB2312ChineseCharacterData[row];
		var pos = areaStr.indexOf(c);
		if( pos > -1 ) {
			row = row.toString(16);
			pos = pos.toString(16);
			var hi = parseInt(row, 16) + 0xB0;
			var lo = parseInt(pos, 16) + 0xA1;
			var encode = hi.toString(16).toUpperCase() + 
						lo.toString(16).toUpperCase(); 
						
			return encode;
		}
	}
	
	throw ("Cann't find in GB2312 character set. ");
	
}

var gotoTenpayLogin = function() {
	top.location.replace("/cgi-bin/v1.0/csair_login_req.cgi?" + "resulturl=" + encodeURIComponent(top.location.href) + "&tmstmp=" + parseInt((new Date()).getTime()/1000));
}

//--------------------------------
//常用字段检查
//--------------------------------

/**
 * <p>18位居民身份证检查</p>
 ------------------------------
	18位身份证号码组成：
	ddddddyyyymmddxxsp共18位，其中：
	其他部分都和15位的相同。年份代码由原来的2位升级到4位。最后一位为校验位。
	校验规则是：
	（1）十七位数字本体码加权求和公式
	S = Sum(Ai * Wi), i = 0, ... , 16 ，先对前17位数字的权求和
	Ai:表示第i位置上的身份证号码数字值
	Wi:表示第i位置上的加权因子
	Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
	（2）计算模
	Y = mod(S, 11)
	（3）通过模得到对应的校验码
	Y: 0 1 2 3 4 5 6 7 8 9 10
	校验码: 1 0 X 9 8 7 6 5 4 3 2 
 ------------------------------
 * @return bool
 */
var checkID18 = function (strTemp) {
	var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
	var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'); 
	var nTemp = 0, i;

	if(strTemp.length==18) {
	
		for(i = 0; i < strTemp.length-1; i ++) {
			nTemp += strTemp.substr(i, 1) * arrInt[i];
		}
		
		if(strTemp.substr(17, 1).toUpperCase() != arrCh[nTemp % 11]) {
			return false;
		}
		
		return true;
		
	}
	
	return false;
}

/**
 * 手机号码检查
 */
var checkMobile = function(mobile) {
	return /^(1[0-9]{10})$/.test(mobile);
}

/**
 * 是否gb2312姓名
 * @param {String} name
 * @return {Boolean}
 */
var isGb2312Name = function(name) {
	var nameReg = /^[\u554A-\u9F44]{2,9}$/;
	var ret = nameReg.test(name);
	for(var index = 0; index < name.length; index++) {
		var codeAt = name.charCodeAt(index);
		console.log(codeAt);
	}
	return ret;
}

var checkQueryResult = function(requestObj) {
	if( !requestObj ) throw ("没有请求参数，请重新选择。");
	
	var back_radio = requestObj.back_radio || 0;
	var from = requestObj.from || "";
	var to = requestObj.to || "";
	var date = requestObj.date || "";
	var date2 = requestObj.date2 || "";
	
	// back_radio
	if( parseInt(back_radio) == 0 ) {
		throw ("back_radio参数只能为1或者为2、3");
	}
	
	// from、to
	if( !isThreeCode(from) ) {
		throw ("错误的出发城市，请重新选择出发城市。");
	}
	if( !isThreeCode(to) ) {
		throw ("错误的到达城市，请重新选择到达城市。");
	}
	if( from == to ) {
		throw ("出发城市不能跟到达城市相同，请重新选择。");
	}
	
	// date、date2
	//date = date.replace(/-/g, '');
	//date2 = date2.replace(/-/g, '');
	
	
	
	if( !date ) {
		throw ("出发日期为空，请选择出发日期。");
	}
	
	if( !checkDate(date) ) {
		throw ("错误的出发日期，请重新选择出发日期。");
	}
	
	if( parseInt(back_radio) == 2 || parseInt(back_radio) == 3 ) {
		if( !date2 ) {
			throw ("返回日期为空，请选择返回日期。");
		}
		if( !checkDate(date2) ) {
			throw ("错误的返回日期，请重新选择返回日期。");
		}
	}
	
	date = parseInt(date.replace(/-/g, ""));
	date2 = parseInt(date2.replace(/-/g, ""));
	var curDate = parseInt(getCurDate().replace(/-/g, ""));
	
	if( date < curDate ) {
		throw ("出发日期小于当前日期，请重新选择出发日期。");
	}
	if( date2 < curDate ) {
		throw ("返回日期小于当前日期，请重新选择返回日期。");
	}
	if( (parseInt(back_radio) == 2 || parseInt(back_radio) == 3) && (date > date2) ) {
		throw ("出发日期不能大于返回日期。");
	}

	// one year later
	var objDate = toDate(date+'');
	var objDate2 = toDate(date2+'');
	var nowDate = new Date();
	var yearTime = 365*24*60*60*1000;
	if( (objDate.getTime() - nowDate.getTime()) >= yearTime ) {
		throw ("航班日期不能在一年以后。");
	}
	if( (parseInt(back_radio) == 2 || parseInt(back_radio) == 3) && (objDate2.getTime() - objDate.getTime() >= yearTime) ) {
		throw ("航班日期不能在一年以后。");
	}
	
	//航线检查
//	if( !CityUtil.isCanFlight(from, to) ) {
//		if( to == 'PVG' && CityUtil.isCanFlight(from, 'SHA') ) {
//			return;
//		}
//		if( to == 'SHA' && CityUtil.isCanFlight(from, 'PVG') ) {
//			return;
//		}
//		
//		var fromCity = CityUtil.getCityNameByCode(from);
//		var toCity = CityUtil.getCityNameByCode(to);
//		throw ("抱歉，暂不支持" + fromCity + "飞往" + toCity);
//	}
	
}

/**
 * 是否三字码
 */
var isThreeCode = function(code) {
	if(code == null) {
		return false;
	}
	
	code = code.trim();
	code = code.toUpperCase();
	if( code.length != 3 ) {
		return false;
	}
	
	var city = CityUtil.getCityNameByCode(code);
	if( city == "" || city == code ) {
		return false;
	}
	
	return true;
}

/**
 * 检查日期
 * @param {String} strDate yyyymmdd或者yyyy-mm-dd
 */
var checkDate = function(strDate) {
	strDate = (strDate+"").replace(/-/g, '');//yyyymmdd
	var checkDateReg = /^\d{8}$/;
	if ( !checkDateReg.test(strDate) ) {
		return false;
	}
	
	var yyyy = parseInt(strDate.substring(0,4));
	var mm = strDate.substring(4,6);
	var dd = strDate.substring(6,8);
	
	if( mm.indexOf('0') == 0 ) {
		mm = parseInt(mm.charAt(1));
	}
	if( dd.indexOf('0') == 0 ) {
		dd = parseInt(dd.charAt(1));
	}
	
	if( yyyy < 2010 || mm < 1 || mm > 12 || dd < 1 || dd > 31) {
		return false;
	}
	
	if(mm == 2) {
		if(isLeapYear(yyyy)) {
			return dd >=1 && dd <= 29;
		}
		
		return dd >= 1 && dd <= 28;
		
	} else if(mm == 4 || mm == 6 || mm == 9 || mm == 11) {
		return dd >= 1 && dd <= 30;
	}
	
	return dd >= 1 && dd <= 31;
}

/**
 * 是否闰年
 * @param {String} year
 */
var isLeapYear = function(year) {
	year = parseInt(year);
	if(year%100 == 0) {
		return year%400 == 0 ;
	} 
	
	return year%4 == 0;
}




//--------------------------------
//位置、事件函数
//--------------------------------
var getCenter = function(obj){
	var p={"left":0,"top":0};
	  var _obj=obj;
	while(obj){
	    p.left+=obj.offsetLeft;
	    p.top+=obj.offsetTop;
		obj=obj.offsetParent;
	}
	var x=p.left+_obj.offsetWidth/2;
	var y=p.top+_obj.offsetHeight/2;
	return {"x":x,"y":y};
}

var getPosition = function(obj){
	var p={"left":0,"top":0};
	while(obj){
		p.left+=obj.offsetLeft;
		p.top+=obj.offsetTop;
		obj=obj.offsetParent;
	}
	return p;
}

var stopBubble = function(e) {
    if ( e && e.stopPropagation )
        e.stopPropagation();
    else
        window.event.cancelBubble = true;
}

var stopDefault = function(e) {
    if ( e && e.preventDefault )
        e.preventDefault();
    else
        window.event.returnValue = false;
    return false;
} 

/**
 * 提示框(依赖于)
 * https://img.tenpay.com/v2.0/js/base.js
 * https://img.tenpay.com/v2.0/box/js/box.js
 */
var alertError = function(errorInfo) {
	Box.text({
		title : "提示",
		infoPic : 4,
		info : errorInfo,
		btns : [["确定", function(){Box.close()}]]
	});
}




//2010-10-27 leungma 添加机型信息
var _plane_types=new Array();
_plane_types['typeAB6']={typename:'A300-600/600C',model:'大型机',min_seat:'207',max_seat:'317'}
_plane_types['typeCRJ']={typename:'区域喷气机',model:'小型机',min_seat:'50',max_seat:'86'}
_plane_types['typeM90']={typename:'MD-90',model:'其他机型',min_seat:'14',max_seat:'无'}
_plane_types['type73G']={typename:'737-700客机',model:'中型机',min_seat:'162',max_seat:'189'}
_plane_types['type143']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type146']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type300']={typename:'A300客机',model:'大型机',min_seat:'250',max_seat:'340'}
_plane_types['type310']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type312']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type313']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type319']={typename:'A319',model:'大型机',min_seat:'107',max_seat:'220'}
_plane_types['type320']={typename:'A320',model:'大型机',min_seat:'174',max_seat:'220'}
_plane_types['type321']={typename:'A321',model:'大型机',min_seat:'256',max_seat:'412'}
_plane_types['type330']={typename:'A330',model:'大型机',min_seat:'256',max_seat:'412'}
_plane_types['type332']={typename:'A330-200',model:'大型机',min_seat:'256',max_seat:'412'}
_plane_types['type333']={typename:'A330-300',model:'大型机',min_seat:'228',max_seat:'420'}
_plane_types['type340']={typename:'A340',model:'大型机',min_seat:'228',max_seat:'335'}
_plane_types['type343']={typename:'A343-300',model:'大型机',min_seat:'313',max_seat:'359'}
_plane_types['type732']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type733']={typename:'733-300客机',model:'中型机',min_seat:'144',max_seat:'171'}
_plane_types['type734']={typename:'737-400客机',model:'中型机',min_seat:'104',max_seat:'132'}
_plane_types['type735']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type736']={typename:'无',model:'无',min_seat:'无',max_seat:'无'}
_plane_types['type737']={typename:'737客机',model:'中型机',min_seat:'162',max_seat:'189'}
_plane_types['type738']={typename:'737-800客机',model:'中型机',min_seat:'177',max_seat:'189'}
_plane_types['type739']={typename:'737-900客机',model:'其他机型',min_seat:'270',max_seat:'无'}
_plane_types['type744']={typename:'747-400客机',model:'大型机',min_seat:'244',max_seat:'569'}
_plane_types['type747']={typename:'747客机',model:'大型机',min_seat:'362',max_seat:'569'}
_plane_types['type757']={typename:'757-200/300客机',model:'大型机',min_seat:'243',max_seat:'289'}
_plane_types['type763']={typename:'767-300/300ER客机',model:'大型机',min_seat:'203',max_seat:'290'}
_plane_types['type767']={typename:'767-200/300客机',model:'大型机',min_seat:'281',max_seat:'440'}
_plane_types['type772']={typename:'777-200客机',model:'大型机',min_seat:'281',max_seat:'440'}
_plane_types['type777']={typename:'777-200/300客机',model:'大型机',min_seat:'260',max_seat:'380'}
_plane_types['type767']={typename:'767-200/300客机',model:'大型机',min_seat:'281',max_seat:'440'}
